﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Acms.Bll;
using Acms.AcmsControls;


namespace TenSevenNine.Web.Templates.Home
{
    public partial class Default : Acms.AcmsControls.TemplatePage
    {
        protected override void OnInit(EventArgs e)
        {

            base.OnInit(e);
            dsImages.SelectData += new EventHandler<Acms.DataControls.SelectEventArgs<Acms.Bll.Post>>(dsTabChildren_SelectData);
            //dlTabTitle.ItemDataBound += new EventHandler<Acms.WebControls.ItemDataBoundEventArgs>(dlTabTitle_ItemDataBound);
            //dlTabTitle.ItemDataBound += new EventHandler<Acms.WebControls.ItemDataBoundEventArgs>(dlTabTitle_ItemDataBound);

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataBind();
            }
        }
        void dsTabChildren_SelectData(object sender, Acms.DataControls.SelectEventArgs<Acms.Bll.Post> e)
        {
            var imageConainer = AcmsContext.CurrentPost.Children.FirstOrDefault(x => x.TemplateName == "Holder");
            if (imageConainer != null)
            {
                e.SetData(imageConainer.Children);
            }
        }
        


    }
}
